package
{
	import flash.display.Graphics;
	import flash.display.Shape;
	import flash.display.Sprite;

	public class AssitLine extends Sprite
	{
		//
		private var m_pShotLine:Shape = new Shape;//射击瞄准线 - 主炮
		private var m_pShotSide:Shape = new Shape;//射击辅助线 - 机枪
		private var m_pShotStop:Shape = new Shape;//射击禁止线 - 以内主炮不发射
		//
		public function AssitLine( t:MomoTank )
		{
			super();
			InitLine(t);
		}
		//
		private function InitLine(t:MomoTank):void{//主炮瞄准线 机枪射击线 主炮禁止线
			var g:Graphics = m_pShotLine.graphics;
			var tx:Number = 0;
			var ty:Number = 0;
			g.lineStyle(0.5,0x00ff00,0.6);
			tx=t.body.gunSetX+t.gun.startX+3;
			ty=t.body.gunSetY;
			g.moveTo(tx,ty);
			g.lineTo(tx+600, ty);
			this.addChild(m_pShotLine);
			g=m_pShotSide.graphics;
			g.lineStyle(0.5,0xffffff,0.8);
			tx=t.body.gunSetX+t.gun.startX*0.8;
			ty=t.body.gunSetY;
			g.moveTo(tx, ty);
			g.lineTo(tx+fun.cos(-25)*400,ty+fun.sin(-25)*400);
			g.moveTo(tx, ty);
			g.lineTo(tx+fun.cos(25)*400,ty+fun.sin(25)*400);
			this.addChild(m_pShotSide);
			g=m_pShotStop.graphics;
			g.lineStyle(1,0xffff00,0.7);
			g.moveTo(tx+fun.cos(-25)*120,ty+fun.sin(-25)*120);
			g.lineTo(tx+fun.cos(-25)*120,ty+fun.sin(25)*120);
			this.addChild(m_pShotStop);
		}
		
	}
}